﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="RenewalQuotes.aspx.cs" Inherits="carinsurance_RenewalQuotes" EnableEventValidation="false" %>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
    <title>
        <%=GetGlobalResourceObject("General", "RenewalQuotesSummary")%>
        - GG-CRM - กล้วยๆ.com - Teledirect Thailand</title>
    <style type="text/css">
        .hiddencol
        {
            display: none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitle" runat="Server">
  <div style="float:left; width:800px">  <h1>
        <asp:Label runat="server" Text="<%$Resources:General,RenewalQuotesSummary%>" ID="lblPageName"></asp:Label></h1></div><div style="float:right"><input id="btnLead" class="blueB ml10" value="Renewal Leads" type="button" onclick="openLead();" /></div>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label runat="server" Text="<%$Resources:General,LangOption%>" Visible="false"
        ID="lblLangOption" />
    <div id="divSearch" runat="server">
        <div class="topdisplay pb10">
            <table width="100%" border="1" cellpadding="10" cellspacing="10" class="flattable">
                <tr>
                    <td width="120">
                        <%=GetGlobalResourceObject("CarInsurance", "ReportType")%>:
                    </td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlReportType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlReportType_SelectedIndexChanged">
                                    <asp:ListItem Value="0" Text="<%$Resources:General,Monthly%>"></asp:ListItem>
                                    <asp:ListItem Value="1" Selected="True" Text="<%$Resources:General,Daily%>"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="<%$Resources:General,Customize%>"></asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;<asp:Label ID="lblFromDate" runat="server"></asp:Label>
                                <asp:DropDownList ID="ddlDay1" runat="server" ToolTip="Choose Day">
                                    <asp:ListItem Value="01">01</asp:ListItem>
                                    <asp:ListItem Value="02">02</asp:ListItem>
                                    <asp:ListItem Value="03">03</asp:ListItem>
                                    <asp:ListItem Value="04">04</asp:ListItem>
                                    <asp:ListItem Value="05">05</asp:ListItem>
                                    <asp:ListItem Value="06">06</asp:ListItem>
                                    <asp:ListItem Value="07">07</asp:ListItem>
                                    <asp:ListItem Value="08">08</asp:ListItem>
                                    <asp:ListItem Value="09">09</asp:ListItem>
                                    <asp:ListItem Value="10">10</asp:ListItem>
                                    <asp:ListItem Value="11">11</asp:ListItem>
                                    <asp:ListItem Value="12">12</asp:ListItem>
                                    <asp:ListItem Value="13">13</asp:ListItem>
                                    <asp:ListItem Value="14">14</asp:ListItem>
                                    <asp:ListItem Value="15">15</asp:ListItem>
                                    <asp:ListItem Value="16">16</asp:ListItem>
                                    <asp:ListItem Value="17">17</asp:ListItem>
                                    <asp:ListItem Value="18">18</asp:ListItem>
                                    <asp:ListItem Value="19">19</asp:ListItem>
                                    <asp:ListItem Value="20">20</asp:ListItem>
                                    <asp:ListItem Value="21">21</asp:ListItem>
                                    <asp:ListItem Value="22">22</asp:ListItem>
                                    <asp:ListItem Value="23">23</asp:ListItem>
                                    <asp:ListItem Value="24">24</asp:ListItem>
                                    <asp:ListItem Value="25">25</asp:ListItem>
                                    <asp:ListItem Value="26">26</asp:ListItem>
                                    <asp:ListItem Value="27">27</asp:ListItem>
                                    <asp:ListItem Value="28">28</asp:ListItem>
                                    <asp:ListItem Value="29">29</asp:ListItem>
                                    <asp:ListItem Value="30">30</asp:ListItem>
                                    <asp:ListItem Value="31">31</asp:ListItem>
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlMonth1" runat="server" AutoPostBack="true" 
                                    onselectedindexchanged="ddlMonth1_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp;
                                <asp:Label ID="lblToDate" runat="server"></asp:Label>
                                <asp:DropDownList ID="ddlDay2" runat="server" ToolTip="Choose Day">
                                    <asp:ListItem Value="01">01</asp:ListItem>
                                    <asp:ListItem Value="02">02</asp:ListItem>
                                    <asp:ListItem Value="03">03</asp:ListItem>
                                    <asp:ListItem Value="04">04</asp:ListItem>
                                    <asp:ListItem Value="05">05</asp:ListItem>
                                    <asp:ListItem Value="06">06</asp:ListItem>
                                    <asp:ListItem Value="07">07</asp:ListItem>
                                    <asp:ListItem Value="08">08</asp:ListItem>
                                    <asp:ListItem Value="09">09</asp:ListItem>
                                    <asp:ListItem Value="10">10</asp:ListItem>
                                    <asp:ListItem Value="11">11</asp:ListItem>
                                    <asp:ListItem Value="12">12</asp:ListItem>
                                    <asp:ListItem Value="13">13</asp:ListItem>
                                    <asp:ListItem Value="14">14</asp:ListItem>
                                    <asp:ListItem Value="15">15</asp:ListItem>
                                    <asp:ListItem Value="16">16</asp:ListItem>
                                    <asp:ListItem Value="17">17</asp:ListItem>
                                    <asp:ListItem Value="18">18</asp:ListItem>
                                    <asp:ListItem Value="19">19</asp:ListItem>
                                    <asp:ListItem Value="20">20</asp:ListItem>
                                    <asp:ListItem Value="21">21</asp:ListItem>
                                    <asp:ListItem Value="22">22</asp:ListItem>
                                    <asp:ListItem Value="23">23</asp:ListItem>
                                    <asp:ListItem Value="24">24</asp:ListItem>
                                    <asp:ListItem Value="25">25</asp:ListItem>
                                    <asp:ListItem Value="26">26</asp:ListItem>
                                    <asp:ListItem Value="27">27</asp:ListItem>
                                    <asp:ListItem Value="28">28</asp:ListItem>
                                    <asp:ListItem Value="29">29</asp:ListItem>
                                    <asp:ListItem Value="30">30</asp:ListItem>
                                    <asp:ListItem Value="31">31</asp:ListItem>
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlMonth2" runat="server" AutoPostBack="true" 
                                    onselectedindexchanged="ddlMonth2_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label runat="server" ID="lblStatus" Text="Status" Visible="false"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;<asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="true" 
                                    onselectedindexchanged="ddlStatus_SelectedIndexChanged" Visible="false">
                                    <asp:ListItem Value="1" Text="<%$Resources:General,CallNow%>"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="<%$Resources:General,Closed%>"></asp:ListItem>
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td width="120">
                        <%=GetGlobalResourceObject("General", "ReferenceNo")%>
                        /<%=GetGlobalResourceObject("CarInsurance", "Name")%>
                        /<%=GetGlobalResourceObject("Proposal", "PlateNumber")%>
                    </td>
                    <td>
                        <asp:TextBox ID="txtSearch" runat="server" Width="250px" MaxLength="50" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="lblMobileNoSearch" Text="<%$Resources:General,Mobile%>" runat="server"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="txtMobileNoSearch" runat="server" Width="240px"
                            MaxLength="10" />&nbsp;
                        <asp:Button ID="btnSubmit" runat="server" Text="<%$Resources:General,Search%>" OnClick="btnSubmit_Click"
                            CssClass="blueB ml10" />
                        <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:Label runat="server" ID="lblRecordCount" CssClass="red" />
            <asp:Button runat="server" Visible="false" CssClass="greenB ml10" ID="btnPrint" Text="<%$Resources:General,Print%>"
                OnClientClick="javascript:window.print();return false;" />
        </div>
        <div class="toggle">
            <div class="title opened" id="opened1">
                <img src="../images/icons/dark/clipboard.png" alt="" class="titleIcon" />
                <h6>
                    <asp:Label runat="server" ID="Label5" Text="<%$Resources:General,ApplicationList%>" />
                </h6>
            </div>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
            <asp:GridView ID="grvApplication" runat="server" AllowPaging="false" AutoGenerateColumns="False"
                CssClass="sTable" GridLines="None" Width="100%" EmptyDataText="<%$Resources:General,ErrNodata%>"
                OnSelectedIndexChanged="grvApplication_SelectedIndexChanged" OnRowDataBound="grvApplication_RowDataBound" DataKeyNames="CECarId, RefCEUserID, ProviderCompanyID, QuoteRefNo">
                <Columns>
                    <asp:BoundField DataField="QuoteRefNo" HeaderText="<%$Resources:CarInsurance,ReferenceNo%>"
                        SortExpression="QuoteRefNo" ItemStyle-Width="70px" />
                    <asp:BoundField DataField="Name" HeaderText="<%$Resources:CarInsurance,Name%>" SortExpression="Name"
                        ItemStyle-Width="120px" />
                    <asp:BoundField DataField="CarPlate" HeaderText="<%$Resources:Proposal,PlateNumber%>"
                        SortExpression="CarPlate" ItemStyle-Width="80px" />
                    <asp:BoundField DataField="CoverageStart" HeaderText="<%$Resources:General,DateTime%>"
                        SortExpression="CoverageStart" ItemStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy}" />
                    <asp:TemplateField ItemStyle-Width="200px" HeaderText="<%$Resources:General,Comments%>">
                    <ItemTemplate>
                        <asp:Literal runat="server" ID="lblCallStatusDesc" />
                        <div style="background-color: #ffffcc;"><strong><%#Eval("Remark")%></strong></div>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="RefCEUserId"
                        SortExpression="RefCEUserId" ><HeaderStyle CssClass="hiddencol" /><ItemStyle CssClass="hiddencol" /></asp:BoundField>
                    <asp:BoundField DataField="CECarId" 
                        SortExpression="CECarId" ><HeaderStyle CssClass="hiddencol" /><ItemStyle CssClass="hiddencol" /></asp:BoundField>
                    <asp:BoundField DataField="NewRefNo" HeaderText="<%$Resources:CarInsurance,NewReferenceNo%>"
                        SortExpression="NewRefNo" ItemStyle-Width="70px"></asp:BoundField>
                    <asp:BoundField DataField="CallFinishType" Visible="false" SortExpression="CallFinishType" />
                    <asp:TemplateField ItemStyle-Width="30px">
                    <ItemTemplate>
                        <asp:HyperLink runat="server" ID="linkPdf" onclick="return CheckLinkExist(this);" Target="_blank"></asp:HyperLink>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField Visible="true" HeaderText="<%$Resources:General,CallNow%>"
                        SelectText="<%$Resources:General,CallNow%>" ShowSelectButton="true" ItemStyle-Width="50px" />
                </Columns>
                <FooterStyle />
                <PagerStyle />
                <SelectedRowStyle BackColor="ActiveBorder" />
                <HeaderStyle />
                <EditRowStyle />
                <AlternatingRowStyle />
                <RowStyle />
            </asp:GridView></ContentTemplate></asp:UpdatePanel>
            <div style="display: none">
                <asp:TextBox ID="txtReportType" runat="server"></asp:TextBox>
                <asp:TextBox ID="txtReportDate1" runat="server"></asp:TextBox>
                <asp:TextBox ID="txtReportDate2" runat="server"></asp:TextBox>
                <asp:TextBox runat="server" ReadOnly="true" ID="txtAgentId"></asp:TextBox>
                <asp:Label ID="lblContent" runat="server"></asp:Label>
            </div>
            <div class="clear">
            </div>
        </div>
        <br />
    </div>
    <script type="text/javascript">
        function CheckLinkExist(obj) {
            var IsExist = false;
            var http = new XMLHttpRequest();
            http.open('HEAD', obj.href, false);
            http.send();

            if (http.status != 404) {
                IsExist = true;
            }
            else {
                alert("No file found!");
            }
            return IsExist;
        }

        function openLead() {
            window.open('renewal-lead-list.aspx', '_blank');
        }
    </script>
</asp:Content>
